package com.ssm.service.impl;

import com.github.pagehelper.PageHelper;
import com.ssm.dao.IOrderDao;
import com.ssm.domain.Order;
import com.ssm.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class OrderServiceImpl implements IOrderService {

    @Autowired
    private IOrderDao iOrderDao;

    @Override
    public List<Order> findAllOrders() throws Exception {
        return iOrderDao.findAllOrders();
    }

    @Override
    public List<Order> findAll(Integer page, Integer size) throws Exception {
        //用于分页操作
        PageHelper.startPage(page,size);
        return iOrderDao.findAll(page,size);
    }

    @Override
    public Order findById(String id) throws Exception {
        return iOrderDao.findById(id);

    }




}
